<!--
//******************************************************************
//* Copyright (c) 2004 Ford Motor Company. All Rights Reserved.
//*
//*
//* $$Workfile:   supplierPopup.jsp  $$
//* $$Revision:   1.0  $$
//* $$Author:   JLOPE262  $$
//* $$Date:   Nov 14 2008 09:13:24  $$
//*
//* Description: Description of file goes here
//******************************************************************
-->
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display-el" %>
<%@ taglib uri="ford-arg/tags" prefix="ft" %>

<script language="javascript">
	function findSupplier() {
		document.SupplierPopupForm.action = "SupplierPopupActionFind.do";
		document.SupplierPopupForm.section.value = "find";
		document.SupplierPopupForm.submit();		
	}
	
	function selectSupplier(supplierClass, supplierCode) {
		supplierClassId = document.SupplierPopupForm.supplierClassId.value;
		supplierCodeId = document.SupplierPopupForm.supplierCodeId.value;		
		window.opener.document.getElementById(supplierClassId).value = supplierClass;
		window.opener.document.getElementById(supplierCodeId).value = supplierCode;
		window.close();
	}
</script>

<table>
	<tr>
		<td colspan="2"><h2><bean:message key="supplier.label.title"/></h2></td>
	</tr>
</table>

<html:form action="/SupplierPopupActionInit">
<html:hidden property="section"/>
<html:hidden property="supplierClassId"/>
<html:hidden property="supplierCodeId"/>

	<bean:define id="supplierClassTitle">
		<bean:message key="supplier.label.classsupplier" />
	</bean:define>
	<bean:define id="supplierCodeTitle">
		<bean:message key="supplier.label.codSupplier" />
	</bean:define>
	<bean:define id="supplierNameTitle">
		<bean:message key="supplier.label.name" />
	</bean:define>	
	
	<table>
		<tr>
			<td class="text_blue_bold align_right">							
				<bean:message key="supplier.label.supplier"/>
			</td>
			<td class="text_blue_bold align_left">
				<html:select property="supplierClass">
					<html:options collection="supplierClasses" property="value" labelProperty="label" />
				</html:select>
				&minus;
				<bean:message key="label.code" />
				<html:text property="supplierCode" maxlength="6" size="6" />
				&nbsp;
				<bean:message key="label.name" />
				<html:text property="supplierName" maxlength="70" size="20" />
				<html:button property="findSupp" onclick="findSupplier();" styleClass="button"><bean:message key="label.find" /></html:button>
			</td>
		</tr>
		<tr>
			<td style="height:15px;" />		
		</tr>
		<tr>
			<td colspan="100%">
				<ft:saveActivePageNumber />
				<display-el:table 	class="table1" cellpadding="5" uid="supplier" style="width:450px;"
									name="sessionScope.SupplierPopupForm.suppliers"  pagesize="15"
									excludedParams="*" requestURI="SupplierPopupActionPaginate.do">			
					<display-el:column title="${supplierClassTitle}" property="eess01SupplierClassCodeC" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" />
					<display-el:column title="${supplierCodeTitle}" property="eess01SupplierCodeC" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" />
					<display-el:column title="${supplierNameTitle}" property="eess01SupplierNameN" class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" />
					<display-el:column class="cell1 text_bold border1_right border1_top align_left" headerClass="header border_right" ><a href="javascript:selectSupplier('${supplier.eess01SupplierClassCodeC}','${supplier.eess01SupplierCodeC}')"><bean:message key="label.select" /></a></display-el:column>					
				</display-el:table>
			</td>
		</tr>
	</table>
</html:form>
